﻿@using CodeCamp.Models.Shared
@model CodeCamp.Models.Email.EmailItemsListViewModel

@{
    Layout = "~/Views/Shared/_LayoutWideSimple.cshtml";
    ViewBag.Title = "";
    if ((@Model != null) && (@Model.EventDisplayName != null))
    {
        ViewBag.Title = @Html.Encode(@Model.EventDisplayName + " | Recent Emails");
    }
    else
    {
        ViewBag.Title = "Code Camp | Recent Emails";
    }
}

@section headaddon {
<style>
    table
    {
        border-collapse: collapse;
        border: solid 1px;
        margin: 0;
    }
    th
    {
        padding: 4px;
    }
    td 
    {
        padding: 4px;
    }
    #content
    {
        width: 900px;
        overflow:scroll;
    }
</style>
}

<h2>Recent Emails</h2>

@if (!string.IsNullOrWhiteSpace(ViewBag.SendResultMessage))
{
    <h3>@ViewBag.SendResultMessage</h3>
}

@if (Model.EmailItems != null)
{
    <div style="min-height:200px;">
    @Html.Partial("Partial/EmailItemsListPartial", @Model.EmailItems)
    </div>
}

@section sidebar {
    @if (User.IsInRole(CCRoles.RoleNames.BigCheeze))
    {
    <div id="eventTagsContainer" class="widget rounded-10">
    <ul>
        <li>@Html.ActionLink("Back to Email Home", "Index")</li>
        <li>@Html.ActionLink("Campaigns", "EmailCampaigns")</li>
        <li>&nbsp;&nbsp;<i>Recent Emails</i></li>
        <li>
            Email Tests:
            <ul>
                <li>@Html.ActionLink("Basic Test", "TestBasicMail")</li>
            </ul>
        </li>
    </ul>
    </div>
    }
}
